// eslint-disable-next-line @typescript-eslint/ban-types
export function setSessionStorage(key: string, value: Object) {
  sessionStorage.setItem(key, JSON.stringify(value));
}

export function removeSessionStorage(key: string) {
  sessionStorage.removeItem(key);
}

export function getSessionStorage(key: string) {
  const str = sessionStorage.getItem(key);
  if (str === 'undefined') return '';
  return JSON.parse(str);
}

// eslint-disable-next-line @typescript-eslint/ban-types
export function setLocalStorage(key: string, value: Object) {
  localStorage.setItem(key, JSON.stringify(value));
}

export function getLocalStorage(key: string) {
  const str = localStorage.getItem(key);
  if (str === 'undefined') return '';
  return JSON.parse(str);
}

export function removeLocalStorage(key: string) {
  localStorage.removeItem(key);
}
